<?php

namespace app\api\controller\v1\distributor;

use app\Request;
use app\services\distributor\DistributorApplicationService;

class DistributorController
{
    public function introduction()
    {
        return app('json')->success(['content' => '经销商文案']);
    }

    public function apply(Request $request)
    {
        $user = $request->user();
        $application_reason = $request->post('application_reason') ?? '';
        $content_phone = $request->post('contact_phone') ?? '';

        $service = app()->make(DistributorApplicationService::class);
        $service->apply($user, $application_reason, $content_phone);

        return app('json')->success(100010);
    }
}